package com.etheart.framework.web.message;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ActionMessage {
	private ActionMessageType type = ActionMessageType.INFO;
	private String title;
	private String content;
	List<SubMessage> messages=new ArrayList<SubMessage>();
	
	public ActionMessage addSubMsg(String content,String label,String href){
		messages.add(new SubMessage(content, label, href));
		return this;
	}
	public ActionMessage addSubMsg(String content){
		messages.add(new SubMessage(content));
		return this;
	}
	public ActionMessage(String title, String content,Map<String, Object> request) {
		super();
		this.title = title;
		this.content = content;
		request.put("actionMessage", this);
	}
	
	public ActionMessage(ActionMessageType type,String content,Map<String, Object> request) {
		super();
		this.type = type;
		this.content = content;
		request.put("actionMessage", this);
	}

	public ActionMessageType getType() {
		return type;
	}
	public void setType(ActionMessageType type) {
		this.type = type;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public List<SubMessage> getMessages() {
		return messages;
	}
	public void setMessages(List<SubMessage> messages) {
		this.messages = messages;
	}
	
	
	
}
